using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_TreeViewItem_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.TreeViewItem);

            field = type.GetField("target", flag);
            app.RegisterCLRFieldGetter(field, get_target_0);
            app.RegisterCLRFieldSetter(field, set_target_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_target_0, AssignFromStack_target_0);
            field = type.GetField("Text", flag);
            app.RegisterCLRFieldGetter(field, get_Text_1);
            app.RegisterCLRFieldSetter(field, set_Text_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Text_1, AssignFromStack_Text_1);
            field = type.GetField("Item", flag);
            app.RegisterCLRFieldGetter(field, get_Item_2);
            app.RegisterCLRFieldSetter(field, set_Item_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_Item_2, AssignFromStack_Item_2);
            field = type.GetField("node", flag);
            app.RegisterCLRFieldGetter(field, get_node_3);
            app.RegisterCLRFieldSetter(field, set_node_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_node_3, AssignFromStack_node_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.TreeViewItem());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.TreeViewItem[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_target_0(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewItem)o).target;
        }

        static StackObject* CopyToStack_target_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewItem)o).target;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_target_0(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewItem)o).target = (huqiang.Core.HGUI.UIElement)v;
        }

        static StackObject* AssignFromStack_target_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UIElement @target = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.TreeViewItem)o).target = @target;
            return ptr_of_this_method;
        }

        static object get_Text_1(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewItem)o).Text;
        }

        static StackObject* CopyToStack_Text_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewItem)o).Text;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Text_1(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewItem)o).Text = (huqiang.Core.HGUI.HText)v;
        }

        static StackObject* AssignFromStack_Text_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.HText @Text = (huqiang.Core.HGUI.HText)typeof(huqiang.Core.HGUI.HText).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.TreeViewItem)o).Text = @Text;
            return ptr_of_this_method;
        }

        static object get_Item_2(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewItem)o).Item;
        }

        static StackObject* CopyToStack_Item_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewItem)o).Item;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Item_2(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewItem)o).Item = (huqiang.UIEvent.UserEvent)v;
        }

        static StackObject* AssignFromStack_Item_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIEvent.UserEvent @Item = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.TreeViewItem)o).Item = @Item;
            return ptr_of_this_method;
        }

        static object get_node_3(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewItem)o).node;
        }

        static StackObject* CopyToStack_node_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewItem)o).node;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_node_3(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewItem)o).node = (huqiang.UIComposite.TreeViewNode)v;
        }

        static StackObject* AssignFromStack_node_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.TreeViewNode @node = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.TreeViewItem)o).node = @node;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.TreeViewItem();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
